﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;

using Acando.Dynamics.CRM.Silverlight.Library.CrmSdk;
//using Acando.Dynamics.CRM.Silverlight.Library.CrmProxyWcf;
namespace Acando.Dynamics.CRM.Silverlight.Library.Helper
{
    public class CrmServiceConversions
    {
        private CrmServiceConversions()
        {  }

        public static ObservableCollection<ItemType> ConvertToCollection<ItemType>(BusinessEntityCollection entities) where ItemType : BusinessEntity
        {
            ObservableCollection<ItemType> list = new ObservableCollection<ItemType>();
            foreach (ItemType be in entities.BusinessEntities)
            {
                list.Add(be);
            }
            return list;
        }
    }
}
